﻿using Utils;

namespace StockModel
{
	public class DailyKeyQuotations	: PropertyChangedNotifier
	{
		#region Attributes

		private Quotation _max;
		private Quotation _min;
		private Quotation _opening;
		private Quotation _closing;
		private Quotation _previousClosing;
		private Quotation _lastOperation;
		private Quotation _lastQuotation;

		#endregion

		#region Properties

		public Quotation Max
		{
			get
			{
				return _max;
			}
			set
			{
				if (_max != value)
				{
					_max = value;
					base.OnPropertyChanged("Max");
				}
			}
		}

		public Quotation Min
		{
			get
			{
				return _min;
			}
			set
			{
				if (_min != value)
				{
					_min = value;
					base.OnPropertyChanged("Min");
				}
			}
		}

		public Quotation Opening
		{
			get
			{
				return _opening;
			}
			set
			{
				if (_opening != value)
				{
					_opening = value;
					base.OnPropertyChanged("Opening");
				}
			}
		}

		public Quotation Closing
		{
			get
			{
				return _closing;
			}
			set
			{
				if (_closing != value)
				{
					_closing = value;
					base.OnPropertyChanged("Closing");
				}
			}
		}

		public Quotation PreviousClosing
		{
			get
			{
				return _previousClosing;
			}
			set
			{
				if (_previousClosing != value)
				{
					_previousClosing = value;
					base.OnPropertyChanged("PreviousClosing");
				}
			}
		}

		public Quotation LastOperation
		{
			get
			{
				return _lastOperation;
			}
			set
			{
				if (_lastOperation != value)
				{
					_lastOperation = value;
					base.OnPropertyChanged("LastOperation");
				}
			}
		}

		public Quotation LastQuotation
		{
			get
			{
				return _lastQuotation;
			}
			set
			{
				if (_lastQuotation != value)
				{
					_lastQuotation = value;
					base.OnPropertyChanged("LastQuotation");
				}
			}
		}

		#endregion

		#region Public Methods

		public void Clear()
		{
			this.Closing = null;
			this.Max = null;
			this.Min = null;
			this.Opening = null;
			this.LastOperation = null;
			this.LastQuotation = null;
			this.PreviousClosing = null;
		}

		#endregion
	}
}
